/*
 Navicat Premium Data Transfer

 Source Server         : localhost_3306
 Source Server Type    : MySQL
 Source Server Version : 80015
 Source Host           : localhost:3306
 Source Schema         : bookstore_0519

 Target Server Type    : MySQL
 Target Server Version : 80015
 File Encoding         : 65001

 Date: 21/03/2020 20:35:02
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for bs_book
-- ----------------------------
DROP TABLE IF EXISTS `bs_book`;
CREATE TABLE `bs_book`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `author` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `price` double(11, 2) NULL DEFAULT NULL,
  `sales` int(11) UNSIGNED NULL DEFAULT NULL,
  `stock` int(11) UNSIGNED NULL DEFAULT NULL,
  `img_path` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci;

-- ----------------------------
-- Records of bs_book
-- ----------------------------
BEGIN;
INSERT INTO `bs_book` VALUES (1, 'wo说不能改', '奥利橙橙', 99.00, 100, 49, 'static/img/default.jpg'), (2, '来啊 快活啊', '反正有 大把时光', 233.00, 200, 60, '/static/img/default.jpg'), (3, '苏东坡传4', '林语堂', 19.30, 200, 70, '/static/img/default.jpg'), (4, '百年孤独', '马尔克斯', 29.50, 200, 80, '/static/img/default.jpg'), (5, '扶桑', '严歌苓', 19.80, 102, 98, '/static/img/default.jpg'), (6, '给孩子的诗', '北岛', 22.20, 105, 95, '/static/img/default.jpg'), (7, '为奴十二年', '所罗门', 16.50, 104, 96, '/static/img/default.jpg'), (8, '平凡的世界', '路遥', 55.00, 102, 98, '/static/img/default.jpg'), (9, '悟空传', '今何在', 14.00, 100, 100, '/static/img/default.jpg'), (10, '硬派健身', '斌卡', 31.20, 100, 100, '/static/img/default.jpg'), (11, '从晚清到民国', '唐德刚', 39.90, 104, 96, '/static/img/default.jpg'), (12, '三体', '刘慈欣', 56.50, 200, 100, '/static/img/default.jpg'), (13, '看见', '柴静', 19.50, 100, 100, '/static/img/default.jpg'), (14, '活着', '余华', 11.00, 100, 100, '/static/img/default.jpg'), (15, '小王子', '安托万', 19.20, 101, 99, '/static/img/default.jpg'), (16, '我们liang', '杨绛', 11.30, 101, 99, '/static/img/default.jpg'), (17, '生命不息,折腾不止', '罗永浩', 25.20, 200, 10, '/static/img/default.jpg'), (18, '皮囊', '蔡崇达', 23.90, 200, 20, '/static/img/default.jpg'), (19, '恰到好处的幸福', '毕淑敏', 16.40, 200, 50, '/static/img/default.jpg'), (20, '艾伦·图灵传', '安德鲁', 47.20, 200, 6, '/static/img/default.jpg'), (21, '大数据预测', '埃里克', 37.20, 106, 94, '/static/img/default.jpg'), (22, '人月神话', '布鲁克斯', 55.90, 102, 98, '/static/img/default.jpg'), (23, 'C语言入门经典', '霍尔顿', 45.00, 102, 98, '/static/img/default.jpg'), (24, '数学之美3', '吴军', 29.90, 101, 99, '/static/img/default.jpg'), (25, 'Java编程思想', '埃史尔', 70.50, 102, 98, '/static/img/default.jpg'), (26, '设计模式之禅', '秦小波', 20.20, 100, 100, '/static/img/default.jpg'), (27, '喜爱夜蒲', '方法', 21.00, 1223, 100, '/static/img/default.jpg'), (28, '黄帝内经', '九天玄女', 99.00, 9999, 70, '/static/img/default.jpg'), (29, '金瓶梅', '小潘', 10.00, 1, 9, '/static/img/default.jpg'), (30, 'JAVA入门到放弃', '坑', 100.00, 100, 10, '/static/img/default.jpg'), (31, '提款姬', '冯友兰', 44.50, 102, 98, '/static/img/default.jpg'), (32, '鱼尾文', ' 劳伦', 19.33, 101, 99, '/static/img/default.jpg'), (33, '冯德顺嘿嘿嘿', 'hahaha', 111.00, 222, 333, '/static/img/default.jpg'), (34, '来啊  开黑啊', '666', 666.00, 666, 666, '/static/img/default.jpg'), (35, '西游记', '吴承恩', 100.98, 1000, 10000, 'static/img/xiyouji.jpg'), (36, '三国演义', '罗贯中', 200.00, 120, 94, '/static/img/default.jpg');
COMMIT;

-- ----------------------------
-- Table structure for bs_order
-- ----------------------------
DROP TABLE IF EXISTS `bs_order`;
CREATE TABLE `bs_order`  (
  `id` char(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `create_date` datetime(0) NULL DEFAULT NULL,
  `total_money` double(11, 2) NULL DEFAULT NULL,
  `status` int(2) NULL DEFAULT NULL,
  `user_id` int(11) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `user_id`(`user_id`) USING BTREE,
  CONSTRAINT `bs_order_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `bs_user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci;

-- ----------------------------
-- Table structure for bs_order_item
-- ----------------------------
DROP TABLE IF EXISTS `bs_order_item`;
CREATE TABLE `bs_order_item`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `price` double(11, 2) NULL DEFAULT NULL,
  `author` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `img_path` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `amount` int(11) NULL DEFAULT NULL,
  `total_money` double(11, 0) NULL DEFAULT NULL,
  `order_id` char(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `order_id`(`order_id`) USING BTREE,
  CONSTRAINT `bs_order_item_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `bs_order` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci;

-- ----------------------------
-- Table structure for bs_user
-- ----------------------------
DROP TABLE IF EXISTS `bs_user`;
CREATE TABLE `bs_user`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `password` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `email` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `username`(`username`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci;

-- ----------------------------
-- Records of bs_user
-- ----------------------------
BEGIN;
INSERT INTO `bs_user` VALUES (1, 'admin', 'admin', 'admin@163.com');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
